namespace SimpleWebServices.Web.UI.Html.Validation
{
    using System.Text.RegularExpressions;

    public class EmailTextValidator : RegexTextValidator
    {
        private static readonly Regex _regex = new Regex(@"^([a-zA-Z0-9_\-\.\+]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");

        public EmailTextValidator()
            : this(null)
        {
        }

        public EmailTextValidator(IInnerElements display)
            : base(display, _regex, true)
        {
        }
    }
}